FROM openshift/golang-builder@sha256:4820580c3368f320581eb9e32cf97aeec179a86c5749753a14ed76410a293d83 AS builder
ENV __doozer=update BUILD_RELEASE=202202262156.p0.gbcfec9c.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202262156.p0.gbcfec9c.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=bcfec9c OS_GIT_VERSION=4.10.0-202202262156.p0.gbcfec9c.assembly.stream-bcfec9c SOURCE_DATE_EPOCH=1637323752 SOURCE_GIT_COMMIT=bcfec9c5a054f4c60356175b42a2477ec181fbd9 SOURCE_GIT_TAG=bcfec9c SOURCE_GIT_URL=https://github.com/uccps-samples/network-tools 
WORKDIR /go/src/github.com/uccps-samples/network-tools
COPY . .

# needed for ovnkube-trace
FROM openshift/ose-ovn-kubernetes:v4.10.0.20220226.220733 AS ovnkube-trace
ENV __doozer=update BUILD_RELEASE=202202262156.p0.gbcfec9c.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202262156.p0.gbcfec9c.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=bcfec9c OS_GIT_VERSION=4.10.0-202202262156.p0.gbcfec9c.assembly.stream-bcfec9c SOURCE_DATE_EPOCH=1637323752 SOURCE_GIT_COMMIT=bcfec9c5a054f4c60356175b42a2477ec181fbd9 SOURCE_GIT_TAG=bcfec9c SOURCE_GIT_URL=https://github.com/uccps-samples/network-tools 

# tools (uccp-tools) is based off cli
FROM openshift/ose-tools:v4.10.0-202202160843.p0.gf93da17.assembly.stream
ENV __doozer=update BUILD_RELEASE=202202262156.p0.gbcfec9c.assembly.stream BUILD_VERSION=v4.10.0 OS_GIT_MAJOR=4 OS_GIT_MINOR=10 OS_GIT_PATCH=0 OS_GIT_TREE_STATE=clean OS_GIT_VERSION=4.10.0-202202262156.p0.gbcfec9c.assembly.stream SOURCE_GIT_TREE_STATE=clean 
ENV __doozer=merge OS_GIT_COMMIT=bcfec9c OS_GIT_VERSION=4.10.0-202202262156.p0.gbcfec9c.assembly.stream-bcfec9c SOURCE_DATE_EPOCH=1637323752 SOURCE_GIT_COMMIT=bcfec9c5a054f4c60356175b42a2477ec181fbd9 SOURCE_GIT_TAG=bcfec9c SOURCE_GIT_URL=https://github.com/uccps-samples/network-tools 
COPY --from=builder /go/src/github.com/uccps-samples/network-tools/debug-scripts/* /usr/bin/
COPY --from=ovnkube-trace /usr/bin/ovnkube-trace /usr/bin/

# Make sure to maintain alphabetical ordering when adding new packages.
RUN INSTALL_PKGS="\
    nginx \
    numactl \
    traceroute \
    wireshark \
    conntrack-tools \
    perf \
    iproute \
    " && \
    yum -y install --setopt=tsflags=nodocs --setopt=skip_missing_names_on_install=False $INSTALL_PKGS && \
    yum clean all && rm -rf /var/cache/*

LABEL \
        name="openshift/ose-network-tools" \
        com.redhat.component="ose-network-tools-container" \
        io.openshift.maintainer.product="OpenShift Container Platform" \
        io.openshift.maintainer.component="Networking" \
        release="202202262156.p0.gbcfec9c.assembly.stream" \
        io.openshift.build.commit.id="bcfec9c5a054f4c60356175b42a2477ec181fbd9" \
        io.openshift.build.source-location="https://github.com/uccps-samples/network-tools" \
        io.openshift.build.commit.url="https://github.com/uccps-samples/network-tools/commit/bcfec9c5a054f4c60356175b42a2477ec181fbd9" \
        version="v4.10.0"

